home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Amiga Format CD 43
/
Amiga Format CD43 (1999)(Future Publishing)(GB)(Track 1 of 2)[!][issue 1999-09].iso
/
-serious-
/
hardware
/
adflib
/
adflibppc
/
lib
/
adf_link.c
< prev
next >
Wrap
C/C++ Source or Header
|
1999-06-14
|
1KB
|
69 lines
/*
* ADF Library
*
* adf_link.c
*
*/
#include<string.h>
#include"adf_defs.h"
#include"adf_str.h"
#include"adf_link.h"
#include"adf_dir.h"
extern struct Env adfEnv;
/*
*
*
*/
char* path(struct Volume *vol, SECTNUM parent)
{
struct bEntryBlock entryBlk;
char *tmpPath;
int len;
tmpPath = NULL;
adfReadEntryBlock(vol, parent, &entryBlk);
len = min(entryBlk.nameLen, MAXNAMELEN);
memcpy(tmpPath,entryBlk.name,len);
tmpPath[len]='\0';
/* if (entryBlk.parent!=vol->rootBlock) {
return(strcat(path(vol,entryBlk.parent), tmpPath));
}
else
*/ return(tmpPath);
}
/*
*
*
*/
RETCODE adfBlockPtr2EntryName(struct Volume *vol, SECTNUM nSect, SECTNUM lPar,
char **name, long *size)
{
struct bEntryBlock entryBlk;
struct Entry entry;
if (*name==0) {
adfReadEntryBlock(vol, nSect, &entryBlk);
*size = entryBlk.byteSize;
return RC_OK;
adfEntBlock2Entry(&entryBlk, &entry); //error
/* if (entryBlk.secType!=ST_ROOT && entry.parent!=lPar)
printf("path=%s\n",path(vol,entry.parent));
*/
*name = strdup("");
if (*name==NULL)
return RC_MALLOC;
return RC_OK;
}
else
return RC_OK;
}
/*##################################################################################*/